!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/export-data",["highcharts","highcharts/modules/exporting"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){function e(t,e,a,o){t.hasOwnProperty(e)||(t[e]=o.apply(null,a))}e(t=t?t._modules:{},"Extensions/DownloadURL.js",[t["Core/Globals.js"]],function(t){var e=t.win,a=e.navigator,o=e.document,i=e.URL||e.webkitURL||e,n=/Edge\/\d+/.test(a.userAgent),r=t.dataURLtoBlob=function(t){if((t=t.replace(/filename=.*;/,"").match(/data:([^;]*)(;base64)?,([0-9A-Za-z+\/]+)/))&&3<t.length&&e.atob&&e.ArrayBuffer&&e.Uint8Array&&e.Blob&&i.createObjectURL){var a=e.atob(t[3]),o=new e.ArrayBuffer(a.length);o=new e.Uint8Array(o);for(var n=0;n<o.length;++n)o[n]=a.charCodeAt(n);return t=new e.Blob([o],{type:t[1]}),i.createObjectURL(t)}};return t=t.downloadURL=function(t,i){var s=o.createElement("a");if("string"==typeof t||t instanceof String||!a.msSaveOrOpenBlob){if(t=""+t,(n||2e6<t.length)&&!(t=r(t)||""))throw Error("Failed to convert to blob");if(void 0!==s.download)s.href=t,s.download=i,o.body.appendChild(s),s.click(),o.body.removeChild(s);else try{var l=e.open(t,"chart");if(null==l)throw Error("Failed to open window")}catch(a){e.location.href=t}}else a.msSaveOrOpenBlob(t,i)},{dataURLtoBlob:r,downloadURL:t}}),e(t,"Extensions/ExportData.js",[t["Core/Axis/Axis.js"],t["Core/Chart/Chart.js"],t["Core/Globals.js"],t["Core/Utilities.js"],t["Extensions/DownloadURL.js"]],function(t,e,a,o,i){function n(t,e){var a=l.navigator,o=-1<a.userAgent.indexOf("WebKit")&&0>a.userAgent.indexOf("Chrome"),i=l.URL||l.webkitURL||l;try{if(a.msSaveOrOpenBlob&&l.MSBlobBuilder){var n=new l.MSBlobBuilder;return n.append(t),n.getBlob("image/svg+xml")}if(!o)return i.createObjectURL(new l.Blob(["\ufeff"+t],{type:e}))}catch(t){}}var r=a.doc,s=a.seriesTypes,l=a.win;a=o.addEvent;var p=o.defined,c=o.extend,d=o.find,h=o.fireEvent,u=o.getOptions,m=o.isNumber,f=o.pick;o=o.setOptions;var x=i.downloadURL;o({exporting:{csv:{annotations:{itemDelimiter:"; ",join:!1},columnHeaderFormatter:null,dateFormat:"%Y-%m-%d %H:%M:%S",decimalPoint:null,itemDelimiter:null,lineDelimiter:"\n"},showTable:!1,useMultiLevelHeaders:!0,useRowspanHeaders:!0},lang:{downloadCSV:"Download CSV",downloadXLS:"Download XLS",exportData:{annotationHeader:"Annotations",categoryHeader:"Category",categoryDatetimeHeader:"DateTime"},viewData:"View data table",hideData:"Hide data table"}}),a(e,"render",function(){this.options&&this.options.exporting&&this.options.exporting.showTable&&!this.options.chart.forExport&&!this.dataTableDiv&&this.viewData()}),e.prototype.setUpKeyToAxis=function(){s.arearange&&(s.arearange.prototype.keyToAxis={low:"y",high:"y"}),s.gantt&&(s.gantt.prototype.keyToAxis={start:"x",end:"x"})},e.prototype.getDataRows=function(e){var a,o=this.hasParallelCoordinates,i=this.time,n=this.options.exporting&&this.options.exporting.csv||{},r=this.xAxis,s={},l=[],c=[],u=[],x=this.options.lang.exportData,g=x.categoryHeader,b=x.categoryDatetimeHeader,y=function(a,o,i){if(n.columnHeaderFormatter){var r=n.columnHeaderFormatter(a,o,i);if(!1!==r)return r}return a?a instanceof t?a.options.title&&a.options.title.text||(a.dateTime?b:g):e?{columnTitle:1<i?o:a.name,topLevelColumnTitle:a.name}:a.name+(1<i?" ("+o+")":""):g},v=function(t,e,a){var o={},i={};return e.forEach(function(e){var n=(t.keyToAxis&&t.keyToAxis[e]||e)+"Axis";n=m(a)?t.chart[n][a]:t[n],o[e]=n&&n.categories||[],i[e]=n&&n.dateTime}),{categoryMap:o,dateTimeValueAxisMap:i}},w=[],D=0;for(T in this.setUpKeyToAxis(),this.series.forEach(function(t){var l,p=t.xAxis,h=t.options.keys||function(t,e){return t.data.filter(function(t){return void 0!==t.y&&t.name}).length&&e&&!e.categories&&!t.keyToAxis?t.pointArrayMap&&t.pointArrayMap.filter(function(t){return"x"===t}).length?(t.pointArrayMap.unshift("x"),t.pointArrayMap):["x","y"]:t.pointArrayMap||["y"]}(t,p),m=h.length,x=!t.requireSorting&&{},g=r.indexOf(p),b=v(t,h);if(!1!==t.options.includeInDataExport&&!t.options.isInternal&&!1!==t.visible){for(d(w,function(t){return t[0]===g})||w.push([g,D]),l=0;l<m;)a=y(t,h[l],h.length),u.push(a.columnTitle||a),e&&c.push(a.topLevelColumnTitle||a),l++;var T={chart:t.chart,autoIncrement:t.autoIncrement,options:t.options,pointArrayMap:t.pointArrayMap};t.options.data.forEach(function(e,a){o&&(b=v(t,h,a));var r={series:T};t.pointClass.prototype.applyOptions.apply(r,[e]),e=r.x;var c=t.data[a]&&t.data[a].name;for(l=0,(!p||"name"===t.exportKey||!o&&p&&p.hasNames&&c)&&(e=c),x&&(x[e]&&(e+="|"+a),x[e]=!0),s[e]||(s[e]=[],s[e].xValues=[]),s[e].x=r.x,s[e].name=c,s[e].xValues[g]=r.x;l<m;)c=r[a=h[l]],s[e][D+l]=f(b.categoryMap[a][c],b.dateTimeValueAxisMap[a]?i.dateFormat(n.dateFormat,c):null,c),l++}),D+=l}}),s)Object.hasOwnProperty.call(s,T)&&l.push(s[T]);var T=e?[c,u]:[u];for(D=w.length;D--;){var A=w[D][0],C=w[D][1],S=r[A];l.sort(function(t,e){return t.xValues[A]-e.xValues[A]}),x=y(S),T[0].splice(C,0,x),e&&T[1]&&T[1].splice(C,0,x),l.forEach(function(t){var e=t.name;S&&!p(e)&&(S.dateTime?(t.x instanceof Date&&(t.x=t.x.getTime()),e=i.dateFormat(n.dateFormat,t.x)):e=S.categories?f(S.names[t.x],S.categories[t.x],t.x):t.x),t.splice(C,0,e)})}return T=T.concat(l),h(this,"exportData",{dataRows:T}),T},e.prototype.getCSV=function(t){var e="",a=this.getDataRows(),o=this.options.exporting.csv,i=f(o.decimalPoint,","!==o.itemDelimiter&&t?1.1.toLocaleString()[1]:"."),n=f(o.itemDelimiter,","===i?";":","),r=o.lineDelimiter;return a.forEach(function(t,o){for(var s,l=t.length;l--;)"string"==typeof(s=t[l])&&(s='"'+s+'"'),"number"==typeof s&&"."!==i&&(s=s.toString().replace(".",i)),t[l]=s;e+=t.join(n),o<a.length-1&&(e+=r)}),e},e.prototype.getTable=function(t){var e='<table id="highcharts-data-table-'+this.index+'">',a=this.options,o=t?1.1.toLocaleString()[1]:".",i=f(a.exporting.useMultiLevelHeaders,!0);t=this.getDataRows(i);var n=0,r=i?t.shift():null,s=t.shift(),l=function(t,e,a,i){var n=f(i,"");return e="text"+(e?" "+e:""),"number"==typeof n?(n=n.toString(),","===o&&(n=n.replace(".",o)),e="number"):i||(e="empty"),"<"+t+(a?" "+a:"")+' class="'+e+'">'+n+"</"+t+">"};!1!==a.exporting.tableCaption&&(e+='<caption class="highcharts-table-caption">'+f(a.exporting.tableCaption,a.title.text?a.title.text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;"):"Chart")+"</caption>");for(var p=0,c=t.length;p<c;++p)t[p].length>n&&(n=t[p].length);return e+=function(t,e,o){var n="<thead>",r=0;o=o||e&&e.length;var s,p=0;if(s=i&&t&&e){t:if(s=t.length,e.length===s){for(;s--;)if(t[s]!==e[s]){s=!1;break t}s=!0}else s=!1;s=!s}if(s){for(n+="<tr>";r<o;++r){s=t[r];var c=t[r+1];s===c?++p:p?(n+=l("th","highcharts-table-topheading",'scope="col" colspan="'+(p+1)+'"',s),p=0):(s===e[r]?a.exporting.useRowspanHeaders?(c=2,delete e[r]):(c=1,e[r]=""):c=1,n+=l("th","highcharts-table-topheading",'scope="col"'+(1<c?' valign="top" rowspan="'+c+'"':""),s))}n+="</tr>"}if(e){for(n+="<tr>",r=0,o=e.length;r<o;++r)void 0!==e[r]&&(n+=l("th",null,'scope="col"',e[r]));n+="</tr>"}return n+"</thead>"}(r,s,Math.max(n,s.length)),e+="<tbody>",t.forEach(function(t){e+="<tr>";for(var a=0;a<n;a++)e+=l(a?"td":"th",null,a?"":'scope="row"',t[a]);e+="</tr>"}),h(this,"afterGetTable",t={html:e+="</tbody></table>"}),t.html},e.prototype.downloadCSV=function(){var t=this.getCSV(!0);x(n(t,"text/csv")||"data:text/csv,\ufeff"+encodeURIComponent(t),this.getFilename()+".csv")},e.prototype.downloadXLS=function(){var t='<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head>\x3c!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>Ark1</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--\x3e<style>td{border:none;font-family: Calibri, sans-serif;} .number{mso-number-format:"0.00";} .text{ mso-number-format:"@";}</style><meta name=ProgId content=Excel.Sheet><meta charset=UTF-8></head><body>'+this.getTable(!0)+"</body></html>";x(n(t,"application/vnd.ms-excel")||"data:application/vnd.ms-excel;base64,"+l.btoa(unescape(encodeURIComponent(t))),this.getFilename()+".xls")},e.prototype.viewData=function(){this.dataTableDiv||(this.dataTableDiv=r.createElement("div"),this.dataTableDiv.className="highcharts-data-table",this.renderTo.parentNode.insertBefore(this.dataTableDiv,this.renderTo.nextSibling),this.dataTableDiv.innerHTML=this.getTable()),""!==this.dataTableDiv.style.display&&"none"!==this.dataTableDiv.style.display||(this.dataTableDiv.style.display="block"),this.isDataTableVisible=!0,h(this,"afterViewData",this.dataTableDiv)},e.prototype.hideData=function(){this.dataTableDiv&&"block"===this.dataTableDiv.style.display&&(this.dataTableDiv.style.display="none"),this.isDataTableVisible=!1},e.prototype.toggleDataTable=function(){var t=this.exportDivElements,e=this.options.exporting;e=e&&e.buttons&&e.buttons.contextButton.menuItems;var a=this.options.lang;this.isDataTableVisible?this.hideData():this.viewData(),null!=g&&g.menuItemDefinitions&&null!=a&&a.viewData&&a.hideData&&e&&t&&t.length&&(t[e.indexOf("viewData")].innerHTML=this.isDataTableVisible?a.hideData:a.viewData)};var g=u().exporting;g&&(c(g.menuItemDefinitions,{downloadCSV:{textKey:"downloadCSV",onclick:function(){this.downloadCSV()}},downloadXLS:{textKey:"downloadXLS",onclick:function(){this.downloadXLS()}},viewData:{textKey:"viewData",onclick:function(){this.toggleDataTable()}}}),g.buttons&&g.buttons.contextButton.menuItems.push("separator","downloadCSV","downloadXLS","viewData")),s.map&&(s.map.prototype.exportKey="name"),s.mapbubble&&(s.mapbubble.prototype.exportKey="name"),s.treemap&&(s.treemap.prototype.exportKey="name")}),e(t,"masters/modules/export-data.src.js",[],function(){})});